package view;

import javax.swing.JPanel;
import javax.swing.border.TitledBorder;
import javax.swing.BoxLayout;

import controller.Controller;
import java.awt.GridLayout;

@SuppressWarnings("serial")
public class QuickView extends JPanel {

	private Controller controller;
	private View view;

	/**
	 * Create the panel.
	 * @param controller 
	 * @param view 
	 */
	public QuickView(Controller controller, View view) {
		this.controller = controller;
		this.view = view;
		
		setBorder(new TitledBorder(null, "Schnellansicht", TitledBorder.LEADING, TitledBorder.TOP, null, null));
		
		initialize();
	}

	private void initialize() {
		
		
		for (String account : controller.getModel().getDataSource().getAccounts()) {
			QuickViewAccount qv = new QuickViewAccount(account);
			
			add(qv);
		}
		
		QuickViewGraphs qg = new QuickViewGraphs();
		add(qg);
		setLayout(new GridLayout(4, 1, 0, 0)); // TODO automate rows
		
		
	}
	
	
}
